<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            display: flex;
            flex-direction: column;
        }
        .inner{
            height: 200px;
            width: 200px;
            border: 1px solid #000;
            overflow: hidden;
        }
        .inner::before{
            content: attr(data-discount);
            background-color: greenyellow;
            display: block;
            line-height: 30px;
            height: 30px;
            text-align: center;
            transform: rotate(-45deg) translateX(-60px) translateY(-38px);
        }
    </style>
</head>
<body>
    <!-- 属性 attribute -->
    <div class="box">
        <div class="inner" data-discount="打7折"></div>
        <div class="inner" data-discount="打8折"></div>
        <div class="inner" data-discount="打6折"></div>
        <div class="inner" data-discount="打5折"></div>
        <div class="inner" data-discount="打骨折"></div>
    </div>
</body>
</html>